<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="baidu-site-verification" content="8cJvlDodzs" />

    <link rel="shortcut icon" href="/assets/img/favicon.ico" />
    <script src="/assets/js/new/jquery-3.4.1.min.js"></script>
    <script src="/assets/js/new/layer/layer.js"></script>
    <link rel="stylesheet" href="/assets/css/new/common.css?v=1610337732">
    <link rel="stylesheet" href="/assets/css/new/home.css?v=1610337732">
    <!--[if IE]>
    <link rel="stylesheet" href="/assets/css/new/ie.css?v=1610337732">
    <![endif]-->
    <title>登录 - ON ZOOM</title>

</head>

<script>
    if(self != top){
        top.location=self.location;
    }
</script>

<div class="layer_notice" style="display: none;">
    <div class="main-content-inner">
        <div class="page-header">
            <h2 class="page-header-heading">选择您要进入的平台</h2>
        </div>
        <div class="form-container" id="choose_button_div" style="margin-top: 30%;">
            <button class="btn-primary" type="button" id="go_com" style="width:46%;float:left;height:32px;margin:0 2% 14px 2%;">企业平台</button>
            <button class="btn-primary" type="button" id="go_sys" style="width:46%;float: left;height:32px;margin:0 2% 14px 2%;">系统平台</button>
            <button class="btn-primary" type="button" id="go_sal" style="width:46%;float:left;height:32px;margin:0 2% 14px 2%;">渠道平台</button>
            <button class="btn-primary" type="button" id="go_eoc" style="width:46%;float:left;height:32px;margin:0 2% 14px 2%;">应急平台</button>
        </div>
    </div>
</div>

<body>

<style>
    .header-logo-img.logo-text{
        width: auto;
        height: 40px;
        margin-top: 12px;
    }
    @media screen and (max-width: 767px) {
        .header-logo-img.logo-text{
            margin-top: 6px;
        }
    }
</style>
<div style="display: none;">
</div>

<div class="header-container  ">
    <div class="header-container-inner clearfix">
        <a href="/index.html" class="header-home-link">
            <img class="header-logo-img logo-text" style="width: 200px; height: 40px;" src="/assets/img/logo.svg" alt="">
        </a>

        <ul class="nav-list-pc-left">
            <li class="nav-list-item"><a href="/admin/downloadcenter/index" class="nav-link">下载中心</a></li>

            <li class="nav-list-item"><a href="#" class="nav-link">支持中心</a></li>
        </ul>

        <ul class="nav-list-pc">
            <li class="nav-list-item"><a href="/admin/conference/joinmeeting" class="nav-link">加入会议</a></li>
            <li class="nav-list-item"><a href="/admin/index/login" class="nav-link">登录</a></li>
            <li class="nav-list-item"><a href="/index.html#/register" class="nav-link nav-link-btn-reg">免费注册</a></li>
        </ul>
        <div class="nav-mobile-container">
            <ul class="nav-list-mobile clearfix">
                <li class="nav-list-item"><a href="/admin/conference/joinmeeting" class="nav-link">加入</a></li>
                <li class="nav-list-item"><a href="/admin/downloadcenter/index" class="nav-link">下载</a></li>
            </ul>
            <button class="btn-toggle-dropdown">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="dropdown-menus-container">
            <ul class="dropdown-menus">
                <li class="menu-item"><a href="/admin/index/login" class="menu-link login-link">登录</a></li>
                <li class="menu-item"><a href="/index.html#/register" class="menu-link">免费注册</a></li>
                <li class="menu-item"><a href="tel:4000805766" class="menu-link">电话: 400-080-5766</a></li>
            </ul>
        </div>
    </div>
</div>
<script>
    // 点击H5右上角菜单按钮
    var isToggling = false;
    $('.btn-toggle-dropdown').click(function() {
        if (isToggling) return;
        isToggling = true;
        $('.dropdown-menus').slideToggle({
            duration: 'fast',
            complete: function() {
                isToggling = false;
            }
        });

        $(this).toggleClass('open');
    });

    // 浮窗加载一
    // var nowon_p = false;
    $("#product").mouseenter(function(){
        t_delay= setTimeout(function(){
            // nowon_p = true;
            $("#productsDropdown").show();
        },50);
    });

    $("#product").mouseleave(function(){
        // nowon_p = false;
        // setTimeout(function(){
        // if (nowon_p == false) {
        clearTimeout(t_delay);
        $("#productsDropdown").hide();
        // }else{
        // nowon_p = false;
        // }
        // },1);
    });

    // 浮窗加载二
    // var nowon_s = false;
    $("#solution").mouseenter(function(){
        t_delay= setTimeout(function(){
            // nowon_s = true;
            $("#solutionsDropdown").show();
        },50);
    });

    $("#solution").mouseleave(function(){
        // nowon_s = false;
        // setTimeout(function(){
        // if (nowon_s == false) {
        clearTimeout(t_delay);
        $("#solutionsDropdown").hide();
        // }else{
        // nowon_s = false;
        // }
        // },1);
    });
</script>


<div class="main-content">
    <div class="main-content-inner">
        <div class="page-header">
            <h2 class="page-header-heading">登录</h2>
        </div>
        <div class="form-container">
            <input type="hidden" id="versiony" value="0" />

            {if $Think.config.fastadmin.login_captcha == true}
            <input type="hidden" id="login_captcha" value="1" />
            {else /}
            <input type="hidden" id="login_captcha" value="0" />
            {/if}
            <form action="" method="post" id="loginform">
                {:token()}
                <input type="hidden" name="go_type" id="go_type" value="" />
                <div class="error-return-message">Error message.</div>
                <div class="form-group">
                    <input type="text" class="form-control " maxlength="128" id="username" name="username" value="" placeholder="手机号" autocomplete="off" />
                    <span class="error-message"></span>
                </div>
                <div class="form-group">
                    <input type="password" id="password" name="password" value="" style="display: none;" />
                    <input type="password" class="form-control" id="password_input" value="" maxlength="30" placeholder="密码" autocomplete="off" />
                    <span class="error-message"></span>
                </div>

                {if $Think.config.fastadmin.login_captcha == true}
                <div class="form-group" style="overflow: hidden;">
                    <input type="text" class="form-control captcha-span-input" id="captcha" name="captcha" value="" maxlength="30" placeholder="验证码" />
                    <!--<img class="captcha-span-img" src="/admin/index/getCaptcha" onclick="this.src = '/admin/index/getCaptcha'" alt="验证码" />-->
                    <img class="captcha-span-img" src="{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha" onclick="this.src = '{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha&r=' + Math.random();" alt="{:__('Captcha')}" />
                    <span class="error-message" style="margin-top: 55px;"></span>
                </div>
                {/if}

                <button class="btn-primary" type="submit">登录</button>
                <div class="form-check clearfix">
                    <input type="checkbox" checked="checked" name="keeplogin" class="form-check-input" id="keeplogin">
                    <label for="keeplogin" class="form-check-label">保持会话</label>
                    <!--<a href="/admin/index/findpwd" class="forgot-password-link">忘记密码？</a>-->
                </div>

            </form>
        </div>
    </div>
</div>

<div class="footer">
    <div class="footer-wrapper">

    </div>

    <div class="footer-bottom">
        <div class="cm-language" style="display: inline-block;">

        </div>
    </div>
</div>


<iframe id="changeLanguageFrame" style="width:0;height:0;" frameborder="0"></iframe>
<script>
    $(document).ready(function(){
        // 判断IE浏览器
        if (window.ActiveXObject || "ActiveXObject" in window) {
            $(".main-content").css({
                "padding-top":"64px",
                "overflow":"auto",
                "flex":"auto"
            });
            $(".home-web").css({"overflow":"hidden"});
            $(".home-mobile").css({"overflow":"hidden"});
            $("#footer_lul").css({"width":"120px"});
            $("#choose_language").css({
                "text-align":"left",
                "font-size":"inherit",
                "left":"-18px",
                "top":"inherit",
                "bottom":"140%",
            });
            $(".join-result-pc").css({"flex":"auto"});
            $(".footer").css({"max-height":"330px","margin-bottom":"30px"});
            $(".warning_footer").show();
        }else{
            $("#choose_language").css({
                "font-size":"inherit",
                "text-align":"left",
                "color":"#000",
                "bottom":"100%",
                "top":"unset",
                "left":"-18px",
                "margin-bottom":"2px"
            });
            $(".join-result-pc").css({"flex":1});
        }

        $("#pricing").click(function(){
            layer.msg($("#pricing_msg").html(), {
                time: 5000
            });
        })

        $("#change_language").click(function(e){
            if($("#choose_language").is(":hidden")) {
                $("#choose_language").show();
                e.stopPropagation();
            }else{
                $("#choose_language").hide();
            }
        });
        $(document.body).click(function(){
            $("#choose_language").hide();
        });

        $("#choose_language a").click(function(){
            var go  = $(this).attr("go");
            $("#changeLanguageFrame").attr("src", "/admin/index/changelanguage?lang="+go);
        })
    })
</script>

<script>
    // 选中国际区号
    $("#countrycode").change(function(){
        $("#PhoneCountryLabel").text($(this).val());
    })

    /* 登录表单校验 - start */
    var usernameTouched = false,
        passwordTouched = false;

    if ($("#login_captcha").val() == 1) {
        var captchaTouched = false;
    }

    $("#username").focus(function(e) {
        if ($(this).parent('.form-group').hasClass('has-error')) {
            clearError('username');
        }

        usernameTouched = true;
    })
    $("#username").blur(function(e) {
        if (usernameTouched) {
            validateUsername();
        }
    })

    $('#password_input').focus(function(e) {
        if ($(this).parent('.form-group').hasClass('has-error')) {
            clearError('password_input');
        }

        passwordTouched = true;
    })
    $('#password_input').blur(function(e) {
        if (passwordTouched) {
            validatePassword();
        }
    });

    if ($("#login_captcha").val() == 1) {
        $('#captcha').focus(function(e) {
            if ($(this).parent('.form-group').hasClass('has-error')) {
                clearError('captcha');
            }

            captchaTouched = true;
        })
        $('#captcha').blur(function(e) {
            if (captchaTouched) {
                validateCaptcha();
            }
        });
    }

    $('#loginform').on('submit', function(e) {
        e.preventDefault();

        if ($("#go_type").val() == "") {
            $("#password").val($("#password_input").val());
        }else{
            $("#password_input").val($("#password").val());
        }

        if (validateUsername() && validatePassword() && validateCaptcha()) {
            $(".btn-primary").attr("disabled", "disabled");

            var index = layer.load(0, {
                shade: false
            }); //0代表加载的风格，支持0-2

            errorReturn("");

            $.ajax({
                url:'/admin/index/login',
                data:$('form').serialize(),
                type:'post',
                success:function(data){
                    layer.close(index);

                    $(".btn-primary").removeAttr("disabled");

                    $("input[name=__token__]").val(data['data']['token']);

                    $("#go_type").val("");

                    if (data['code']==1) {
                        if (data['data']['type'] == 'choose_login') {
                            if (data['data']['count_arr'][0] == 0) {
                                $("#go_com").hide();
                            }else{
                                $("#go_com").show();
                            }
                            if (data['data']['count_arr'][1] == 0) {
                                $("#go_sys").hide();
                            }else{
                                $("#go_sys").show();
                            }
                            if (data['data']['count_arr'][2] == 0) {
                                $("#go_sal").hide();
                            }else{
                                $("#go_sal").show();
                            }
                            if (data['data']['count_arr'][3] == 0) {
                                $("#go_eoc").hide();
                            }else{
                                $("#go_eoc").show();
                            }

                            if (data['data']['existence_num'] > 2) {
                                $("#choose_button_div").css("margin-top", "20%");
                            }else{
                                $("#choose_button_div").css("margin-top", "30%");
                            }

                            var screen_w = $(window).width();
                            if (screen_w < 768) {
                                var area_w = '98%';
                                var area_t = '150px';
                            }else{
                                var area_w = '420px';
                                var area_t = '165px';
                            }

                            layer.open({
                                type: 1,
                                area: [area_w, '290px'],
                                skin: 'layer_logintop',
                                // shadeClose: true,
                                closeBtn: 0,
                                title: false,
                                content: $('.layer_notice'),
                            });
                            $(".layer_logintop").css("top",area_t);

                            $('#choose_button_div').children().eq(0).focus();
                        }else{
                            window.location.href='/admin/' + data['data']['url'];
                        }
                    }else{
                        errorReturn(data['msg']);
                        //$(".captcha-span-img").attr("src", "/index.php?s=/captcha&r=" + Math.random());
                        $(".captcha-span-img").attr("src", "/admin/index/getCaptcha?=" + Math.random());
                    }
                }
            });

            return false;
        }

        return false;
    });

    $("#go_com").click(function(){
        $("#go_type").val("company");
        layer.closeAll();
        $('#loginform').submit();
    });
    $("#go_sys").click(function(){
        $("#go_type").val("system");
        layer.closeAll();
        $('#loginform').submit();
    });
    $("#go_sal").click(function(){
        $("#go_type").val("saleschannel");
        layer.closeAll();
        $('#loginform').submit();
    });
    $("#go_eoc").click(function(){
        $("#go_type").val("eoc");
        layer.closeAll();
        $('#loginform').submit();
    });

    function validateUsername() {
        clearError('username');
        var username = $('#username').val();
        var errorMessage = '';

        if ($("#versiony").val() == 1) {
            var rMobile = /^1[3-9]\d{9}$/;
            if (username.trim() === '') {
                errorMessage = "请输入手机号";
            } else if (!rMobile.test(username)) {
                errorMessage = "手机号不正确";
            }
        } else {
            if (username.trim() === '') {
                errorMessage = "请输入您的账号";
            }
        }

        if (errorMessage) {
            showError('username', errorMessage);
            return false;
        } else {
            return true;
        }

    }

    function validatePassword() {
        clearError('password_input');

        var password = $('#password_input').val();
        var errorMessage = '';
        if (password === '') {
            errorMessage = "请输入密码";
        }

        if (errorMessage) {
            showError('password_input', errorMessage);
            return false;
        } else {
            return true;
        }

    }

    function validateCaptcha() {
        if ($("#login_captcha").val() == 1) {
            clearError('captcha');

            var captcha = $('#captcha').val();
            var errorMessage = '';
            if (captcha.trim() === '') {
                errorMessage = "请输入验证码";
            }

            if (errorMessage) {
                showError('captcha', errorMessage, 'captcha');
                return false;
            } else {
                return true;
            }
        }else{
            return true;
        }
    }

    function showError(inputIdName, errorMessage, type) {
        var inputElement = $('#' + inputIdName);
        if (inputElement.length) {
            if (type != 'captcha') {
                inputElement.next('.error-message').text(errorMessage);
            }else{
                inputElement.next().next('.error-message').text(errorMessage);
            }
            inputElement.parent('.form-group').addClass('has-error');
        }
    }

    function clearError(inputIdName) {
        var inputElement = $('#' + inputIdName);
        if (inputElement.length) {
            if (inputIdName != 'captcha') {
                inputElement.next('.error-message').empty();
            }else{
                inputElement.next().next('.error-message').empty();
            }
            inputElement.parent('.form-group').removeClass('has-error');
        }
    }

    /* 登录表单校验 - end */

    function errorReturn(msg) {
        if (msg == '') {
            $(".error-return-message").html("");
            $(".error-return-message").hide();
        }else{
            $(".error-return-message").html(msg);
            $(".error-return-message").show();
        }
    }
</script>
</body>
</html>